/*
 * Copyright (c) 2025 Industrial Software Feature Database
 */
package com.comac.ins.cax.service.strategy.impl;

import com.comac.ins.cax.enums.CaxConvertFileType;
import com.comac.ins.cax.enums.CaxConvertType;
import com.comac.ins.cax.service.strategy.ConversionStrategy;

/**
 * @author yk
 * @desc 转换策略工厂
 * @date 2024-06-18 16:24
 */
public class ConversionStrategyFactory {
    public static ConversionStrategy getConversionStrategy(CaxConvertType caxConvertType, CaxConvertFileType inputType, CaxConvertFileType outputType) {
        if (CaxConvertType.CAD.equals(caxConvertType) && CaxConvertFileType.STEP.equals(inputType) && CaxConvertFileType.OBJ.equals(outputType)) {
            return new CadStepToObjConverter();
        } else if (CaxConvertType.CAE.equals(caxConvertType) && CaxConvertFileType.BDF.equals(inputType) && CaxConvertFileType.INP.equals(outputType)) {
            return new CaeBdfToInpConverter();
        } else if (CaxConvertType.CAE.equals(caxConvertType) && CaxConvertFileType.OP2.equals(inputType) && CaxConvertFileType.VTK.equals(outputType)) {
            return new CaeOp2ToVtkConverter();
        }
        throw new RuntimeException("不支持的转换类型或文件类型");
    }
}
